#! /usr/bin/python
# -*- coding: utf-8 -*-
from logs import logging as log


def add_two_arrary(arrary1, arrary2):
    try:
        c = [i+j for i, j in zip(arrary1, arrary2)]  # 将两个数组相加,两个数组必须类型一致
        log.info(c)
    except Exception, e:
        log.error("can't add the two arrary, reason= %s" % e)
    return c

if __name__ == '__main__':
    x = add_two_arrary([1, 2, 3], [6, 5, 4])
    y = add_two_arrary(['add', 'no', 'data'], ['are', 'same', 'eeee'])
    z = add_two_arrary([1, 2, 3], [7,6,5,4,3])  # 如果是同类型,则会选择数量较少的数组作为基准进行相加操作.
    print 'x=%s, y=%s, z=%s' % (x, y, z)
